import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class HJ14 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        ArrayList<String> list = new ArrayList<String>();
        if(sc.hasNextLine()){
            int num = Integer.parseInt(sc.nextLine());//有几行
            for(int i = num; i > 0;i--){
                String str = sc.nextLine();
                list.add(str);
            }
        }

        Collections.sort(list);
        for(String s : list){
            System.out.println(s);
        }
    }
}
